package net.wanho.shop.mapper;

import net.wanho.shop.dto.OrderDTO;
import net.wanho.shop.po.Order;
import net.wanho.shop.vo.OrderDetailVO;
import net.wanho.shop.vo.OrderVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 订单表 Mapper 接口
 * </p>
 *
 * @author 猛虎王
 * @since 2024-12-24
 */
@Mapper
public interface OrderMapper {

    List<Order> select(Order order);

    List<OrderDetailVO> selectById(Integer orderId);

    void insert(Order order);

    void update(Order order);

    void deleteById(Serializable orderId);

    void deleteByIds(String[] split);

    List<OrderVo> selectAll(OrderDTO orderDTO);

    void updateByOrderId(@Param("orderId") Integer orderId, @Param("status") Integer status);

    void sendOrder(@Param("orderId") Integer orderId, @Param("no") String no);

    void updateAddressByOrderId(@Param("orderId") Integer orderId, @Param("consigneeAddr") String consigneeAddr);

    int selectCount();

    Order selectByOrderId(Integer orderId);

    Double selectSalesAmount();

    List<Integer> selectTimeoutPay(@Param("timeout") LocalDateTime timeout, @Param("status") Integer status);


    void updateTimeoutPay(@Param("orderIds") List<Integer> orderIds, @Param("status") Integer status);

    List<Integer> selectReceivePay(@Param("receive") LocalDateTime receive, @Param("status") Integer status);

    void updateReceivePay(@Param("orderIds") List<Integer> orderIds, @Param("status") Integer status);

    void updateByOrderNumber(@Param("orderNumber") String orderNumber, @Param("status") Integer status);
}
